<%--
  Created by IntelliJ IDEA.
  User: tianfei
  Date: 2021/7/6
  Time: 19:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%@include file="../include/include-head.jsp" %>
</head>

<body>

<%@include file="../include/include-nav.jsp" %>

<div class="container-fluid">
    <div class="row">
        <%@include file="../include/include-sidebar.jsp" %>

        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1 class="page-header">控制面板</h1>

            Principal：com.tianfei.crowd.mvc.config.SecurityAdmin<br/>
            不难发现 principal 是我们自己封装的 SecurityAdmin 对象<br/>
            SpringSecurity 处理完登录操作之后把登录成功的 User 对象以 principal 属性名存入了 UsernamePasswordAuthenticationToken<br/>
            Principal：<scurity:authentication property="principal.class.name"/><br/>
            访问SecurityAdmin对象的属性：<scurity:authentication property="principal.originalAdmin.loginAcct"/><br/>
            访问SecurityAdmin对象的属性：<scurity:authentication property="principal.originalAdmin.userPwd"/><br/>
            访问SecurityAdmin对象的属性：<scurity:authentication property="principal.originalAdmin.userName"/><br/>
            访问SecurityAdmin对象的属性：<scurity:authentication property="principal.originalAdmin.email"/><br/>
            访问SecurityAdmin对象的属性：<scurity:authentication property="principal.originalAdmin.createTime"/><br/>
            <%--            Credentials：<p><scurity:authentication property="credentials.class.name"/></p>--%>
            <div class="row placeholders">
                <security:authorize access="hasRole('经理')">
                    <div class="col-xs-6 col-sm-3 placeholder">
                        <img data-src="holder.js/200x200/auto/sky" class="img-responsive"
                             alt="Generic placeholder thumbnail">
                        <h4>Label</h4>
                        <span class="text-muted">Something else</span>
                    </div>
                </security:authorize>
<%--                <security:authorize access="hasAuthority('role:add')">--%>
                    <div class="col-xs-6 col-sm-3 placeholder">
                        <img data-src="holder.js/200x200/auto/vine" class="img-responsive"
                             alt="Generic placeholder thumbnail">
                        <h4>Label</h4>
                        <span class="text-muted">Something else</span>
                    </div>
<%--                </security:authorize>--%>

                <div class="col-xs-6 col-sm-3 placeholder">
                    <img data-src="holder.js/200x200/auto/sky" class="img-responsive"
                         alt="Generic placeholder thumbnail">
                    <h4>Label</h4>
                    <span class="text-muted">Something else</span>
                </div>
                <div class="col-xs-6 col-sm-3 placeholder">
                    <img data-src="holder.js/200x200/auto/vine" class="img-responsive"
                         alt="Generic placeholder thumbnail">
                    <h4>Label</h4>
                    <span class="text-muted">Something else</span>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>

